
<template>
	<!-- 考勤-晨检-记录晨检信息 -->
	<div>
		<el-row>
			<span class="formLable">基本信息</span>
		</el-row>
		<el-row :gutter="16">
			<el-col :span="4">
				<span class="formLable">学员姓名</span>
			</el-col>
			<el-col :span="4">
				<span class="formValue">麦学校</span>
			</el-col>
			<el-col :span="4">
				<span class="formLable">所在班级</span>
			</el-col>
			<el-col :span="4">
				<span class="formValue">年级+班级</span>
			</el-col>
		</el-row>
		<el-row>
			<span class="formLable">晨检信息</span>
		</el-row>
		<el-row>
			<el-col :span="4">
				<span class="formLable">晨检状态</span>
			</el-col>
			<el-col :span="20">
				<el-radio-group v-model="saveParam.statu">
					<el-radio :label="3">未晨检</el-radio>
					<el-radio :label="6">晨检正常</el-radio>
					<el-radio :label="9">晨检异常</el-radio>
				</el-radio-group>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="4">
				<span class="formLable">晨检症状</span>
			</el-col>
			<el-col :span="20">
				<el-checkbox-group v-model="saveParam.symptom">
					<el-checkbox v-for="symptom in symptomList" :label="symptom"
					 :key="symptom">{{symptom}}</el-checkbox>
					 <el-button style="margin-left:0.1rem;" size="mini" @click="addSymptomPopup.visible=true">添加标签</el-button>
				</el-checkbox-group>
				
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="4">
				<span class="formLable">是否带药</span>
			</el-col>
			<el-col :span="20">
				<el-checkbox v-model="saveParam.medicine">带药</el-checkbox>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="4">
				<span class="formLable">处理结果</span>
			</el-col>
			<el-col :span="20">
				<el-radio-group v-model="saveParam.result">
					<el-radio :label="3">同意入园</el-radio>
					<el-radio :label="6">重点观察</el-radio>
					<el-radio :label="9">家长带回</el-radio>
				</el-radio-group>
			</el-col>
		</el-row>
		<el-row>
			<el-col :span="4">
				<span class="formLable">备注：</span>
			</el-col>
			<el-col :span="20">
				<el-input
					type="textarea"
					placeholder="请输入内容"
					v-model="saveParam.remark"
					maxlength="100"
					:rows="4"
					show-word-limit
					>
				</el-input>
			</el-col>
		</el-row>
		<el-row style="text-align:center;">
			<el-button @click="cancle">取消</el-button>
			<el-button @click="save">确定记录</el-button>
		</el-row>

		<el-dialog
			title="添加标签"
			:visible.sync="addSymptomPopup.visible"
			:close-on-click-modal="false"
			:modal="false"
			width="25%"
			style="margin-top:17vh;">
				<el-row>
					<el-col :span="6">
						<span class="formLable must">标签名称</span>
					</el-col>
					<el-col :span="18">
						<el-input v-model="addSymptomPopup.value"></el-input>
					</el-col>
				</el-row>
				<el-row style="text-align:center;">
					<el-button @click="addSymptomPopup.visible=false">取消</el-button>
					<el-button @click="saveSymptom">确定添加</el-button>
				</el-row>
		</el-dialog>
	</div>
</template>

<script>
	let vm;
	export default{
		components:{},
		data(){
			return {
				isEdite:true,
				saveParam:{
					statu:'',
					symptom:[],
					medicine:'',
					result:'',
				},
				symptomList:[
					'发热','流鼻涕','咳嗽','腹泻','喉咙发炎',
					'指甲过长','疑似传染病','红眼病','其他',
				],
				addSymptomPopup:{
					visible:false,
					value:'',
				}
			}
		},
		methods:{
			init(data){
				this.isEdite=data.isEdite;
			},
			cancle(){
				this.$emit('cancle',false);
			},
			save(){
				
				this.$emit('cancle',false);
			},
			saveSymptom(){
				if(!this.addSymptomPopup.value){
					this.$message({
						type:'warning',
						message:'标签名称不可为空！'
					});
					return;
				}
				this.symptomList.push(this.addSymptomPopup.value);
				this.addSymptomPopup.visible=false;
			},
		},
		mounted(){
			vm=this;
		},
		computed:{
			
		},
		watch:{

		}
	}
</script>

<style lang="scss" scoped>
	.formLable,.formValue{
		font-size: 0.16rem;
		line-height: 0.4rem;
	}
	.formLable.must::before{
		content: '*';
		color: red;
		margin: 0 0.05rem;
	}
	.el-row{
		margin-bottom: 0.16rem;
	}
	.el-checkbox{
		font-size: 0.16rem;
		line-height: 0.4rem;
	}
	.el-radio{
		font-size: 0.16rem;
		line-height: 0.4rem;
	}
</style>